"""
# -*- coding: utf-8 -*-
Time    : 2025/7/21 下午5:37
Author  : Micah
File    : test_fixture_data.py
Function:
"""

import pytest
import csv


@pytest.fixture()
def read_data():
    with open('userinfo.csv') as f:
        row = csv.reader(f, delimiter=',')
        next(row)       # 不读取首行，跳到下一行
        users = []
        for i in row:
            users.append(i)     # 读取的字段均为str类型
    return users


def test_login(read_data):
    name = read_data[0][0]
    age = read_data[0][1]
    print(f'\n用户名是：{name}，年龄是：{age}')
